home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / X11 / config / lnxLib.rules < prev    next >
Text File  |  2006-04-12  |  24KB  |  681 lines

  1. XCOMM $Xorg: lnxLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
  2. XCOMM $XFree86: xc/config/cf/lnxLib.rules,v 3.52 2003/10/31 20:49:03 herrb Exp $
  3.  
  4. /*
  5.  * Linux shared library rules (DLL & ELF versions)
  6.  */
  7. #ifndef HasSharedLibraries
  8. # define HasSharedLibraries YES
  9. #endif
  10. #ifndef ForceNormalLib
  11. # define ForceNormalLib NO
  12. #endif
  13.  
  14. #ifndef UseRpath
  15. #define UseRpath NO
  16. #endif
  17.  
  18. #ifndef SharedOldX
  19. # define SharedOldX NO
  20. #endif
  21.  
  22. #if UseElfFormat
  23.  
  24. # if (LinuxCLibMajorVersion >= 5 && LinuxCLibMinorVersion >= 4) || LinuxCLibMajorVersion >= 6
  25. #  ifndef SpecialMalloc
  26. #   define SpecialMalloc NO
  27. #  endif
  28. #if 0
  29. #  ifndef UseInternalMalloc
  30. #   define UseInternalMalloc NO
  31. #  endif
  32. #endif
  33. # endif
  34.  
  35. # if LinuxCLibMajorVersion <= 5
  36. /*
  37.  *    #define BaseShLibReqs    -lc
  38.  *
  39.  * I don't want to use this since the normal ELF executables should
  40.  * be linked with libc.so. If it is not, i.e., static, the variables in
  41.  * libc.so which is loaded in because of the other shared libraries
  42.  * may have different values than the ones in the static ELF
  43.  * executables. That happens if the binaries are linked with libg.a
  44.  * or libc_p.a.
  45.  *
  46.  * If an ELF executable linked with libg.a or libc_p.a loads a shared
  47.  * object which needs libc.so via dlopen (), I think it should fail.
  48.  * It is a very bad idea. The moral story is DON'T USE dlopen () IN
  49.  * ELF EXECUTABLES LINKED WITH libg.a OR libc_p.a. H.J.
  50.  *
  51.  */
  52. #  define BaseShLibReqs
  53. # else
  54. /* With GNU libc 2 this works fine. */
  55. #  define BaseShLibReqs    -lc
  56. # endif
  57.  
  58. # ifndef SharedDataSeparation
  59. #  define SharedDataSeparation NO
  60. # endif
  61. # ifndef SharedCodeDef
  62. #  define SharedCodeDef /**/
  63. # endif
  64. # ifndef SharedLibraryDef
  65. #  define SharedLibraryDef /**/
  66. # endif
  67. # ifndef ShLibIncludeFile
  68. #  define ShLibIncludeFile <lnxLib.tmpl>
  69. # endif
  70. #ifndef RpathLoadFlags
  71. #if UseRpath
  72. #define RpathLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
  73. #else
  74. #define RpathLoadFlags /**/
  75. #endif
  76. #endif
  77. #ifndef LibraryRpathLoadFlags
  78. #define LibraryRpathLoadFlags RpathLoadFlags
  79. #endif
  80. # ifndef SharedLibraryLoadFlags
  81. #  define SharedLibraryLoadFlags -shared
  82. # endif
  83. # ifndef PositionIndependentCFlags
  84. #  define PositionIndependentCFlags -fPIC
  85. # endif
  86. # ifndef PositionIndependentCplusplusFlags
  87. #  define PositionIndependentCplusplusFlags -fPIC
  88. # endif
  89. # ifndef ExtraLoadFlags
  90. #  if LinuxBinUtilsMajorVersion >= 26
  91. #   ifdef UseInstalled
  92. #    if LinuxBinUtilsMajorVersion < 27
  93. #     define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link,$(USRLIBDIRPATH)
  94. #    endif
  95. #   else
  96. #    define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link,$(BUILDLIBDIR)
  97. #   endif
  98. #  else
  99. #   define ExtraLoadFlags RpathLoadFlags
  100. #  endif
  101. # endif
  102. # ifndef HardCodeLibdirFlag
  103. #  define HardCodeLibdirFlag RpathLoadFlags
  104. # endif
  105. # if !defined(ShlibGlobalsFlags)
  106. #  define ShlibGlobalsFlags -Wl,-Bsymbolic
  107. # endif
  108.  
  109. /*
  110.  * InstallSharedLibrary - generate rules to install the shared library.
  111.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  112.  */
  113. # ifndef InstallSharedLibrary
  114. #  define    InstallSharedLibrary(libname,rev,dest)            @@\
  115. install:: Concat(lib,libname.so.rev)                     @@\
  116.     MakeDir($(DESTDIR)dest)                        @@\
  117.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  118.     @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`;\
  119.       set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T    @@\
  120.     @if $(SOSYMLINK); then (set -x; \
  121.       $(RM) Concat($(DESTDIR)dest/lib,libname.so); \        @@\
  122.       $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)); fi
  123. # endif /* InstallSharedLibrary */
  124.  
  125. # ifndef InstallSharedLibtoolLibrary
  126.  
  127. #  define SetRevisions(rev) V=`expr rev : '\([^:]*\)'`; \        @@\
  128.         R=`expr rev : '.*:\([^:]*\):'`; \            @@\
  129.         A=`expr rev : '.*:\([^:]*\)'`; \            @@\
  130.         MAJ=`expr $$V - $$A`; \                    @@\
  131.         MIN=$$A.$$R
  132.  
  133. #  define    InstallSharedLibtoolLibrary(libname,rev,dest)        @@\
  134. install:: Concat(lib,libname.so)                     @@\
  135.     MakeDir($(DESTDIR)dest)                        @@\
  136.     @set +e; SetRevisions(rev); \                    @@\
  137.         set -xe; \                        @@\
  138.         $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.$$MAJ.$$MIN) $(DESTDIR)dest; \ @@\
  139.         $(RM) Concat($(DESTDIR)dest/lib,libname.so.$$MAJ); \    @@\
  140.         $(LN) Concat(lib,libname.so.$$MAJ.$$MIN) Concat($(DESTDIR)dest/lib,libname.so.$$MAJ); \ @@\
  141.         $(RM) Concat($(DESTDIR)dest/lib,libname.so); \        @@\
  142.         $(LN) Concat(lib,libname.so.$$MAJ.$$MIN) Concat($(DESTDIR)dest/lib,libname.so)
  143. # endif /* InstallSharedLibrary */
  144.  
  145. /*
  146.  * InstallSharedLibraryData - generate rules to install the shared library data
  147.  */
  148. # ifndef InstallSharedLibraryData
  149. #  define    InstallSharedLibraryData(libname,rev,dest)
  150. # endif /* InstallSharedLibraryData */
  151.  
  152.  
  153. /*
  154.  * SharedLibraryTarget - generate rules to create a shared library;
  155.  * build it into a different name so that we do not hose people by having
  156.  * the library gone for long periods.
  157.  */
  158. # ifndef SharedLibraryTarget
  159. #  define SharedLibraryTarget(libname,rev,solist,down,up)        @@\
  160. AllTarget(Concat(lib,libname.so.rev))                    @@\
  161.                                     @@\
  162. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  163.     $(RM) $@~                            @@\
  164.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; (set -x; \    @@\
  165.         cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs) || exit 1; \ @@\
  166.         (set -x; $(RM) $$SONAME; $(LN) $@ $$SONAME); \        @@\
  167.         LinkBuildSonameLibrary($$SONAME)            @@\
  168.     $(RM) $@                             @@\
  169.     $(MV) $@~ $@                            @@\
  170.     @if $(SOSYMLINK); then (set -x; \                @@\
  171.       $(RM) Concat(lib,libname.so); \                @@\
  172.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  173.     LinkBuildLibrary($@)                        @@\
  174.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  175.                                     @@\
  176. clean::                                    @@\
  177.     @MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \    @@\
  178.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  179.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  180.  
  181. # endif /* SharedLibraryTarget */
  182.  
  183.  
  184. # ifndef SharedLibtoolLibraryTarget
  185. #  define SharedLibtoolLibraryTarget(libname,rev,solist,down,up)    @@\
  186. AllTarget(Concat(lib,libname.so))                    @@\
  187.                                     @@\
  188. Concat(lib,libname.so):  solist $(EXTRALIBRARYDEPS)            @@\
  189.     $(RM) $@~                            @@\
  190.     @set +e; SetRevisions(rev); set -e; \                @@\
  191.         SONAME=$@.$$MAJ; \                    @@\
  192.         (set -x; \                        @@\
  193.         $(RM) $@.$$MAJ.$$MIN~; \                @@\
  194.         cd down; $(CC) -o up/$@.$$MAJ.$$MIN~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs) || exit 1; \ @@\
  195.         (set -x; \                        @@\
  196.         $(RM) $$SONAME; $(LN) $@.$$MAJ.$$MIN $$SONAME); \    @@\
  197.         LinkBuildSonameLibrary($$SONAME); \            @@\
  198.         (set -x; \                        @@\
  199.         $(RM) $@.$$MAJ.$$MIN; \                    @@\
  200.         $(MV) $@.$$MAJ.$$MIN~ $@.$$MAJ.$$MIN; \            @@\
  201.           $(RM) $@; \                        @@\
  202.           $(LN) $@.$$MAJ.$$MIN $@); \                @@\
  203.         LinkBuildLibraryInline($@.$$MAJ.$$MIN); \        @@\
  204.         LinkBuildLibraryInline($@)                @@\
  205.                                     @@\
  206. clean::                                    @@\
  207.     @set +e; SetRevisions(rev); \                    @@\
  208.         set -xe; \                        @@\
  209.         $(RM) Concat(lib,libname.so.$$MAJ); \            @@\
  210.         $(RM) Concat(lib,libname.so.$$MAJ.$$MIN)        @@\
  211.     $(RM) Concat(lib,libname.so)
  212.  
  213. # endif /* SharedLibtoolLibraryTarget */
  214.  
  215. /*
  216.  * SharedDepLibraryTarget - generate rules to create a shared library.
  217.  */
  218. # ifndef SharedDepLibraryTarget
  219. #   define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  220. AllTarget(Concat(lib,libname.so.rev))                    @@\
  221.                                     @@\
  222. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  223.     $(RM) $@~                            @@\
  224.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \        @@\
  225.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  226.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  227.         LinkBuildSonameLibrary($$SONAME)            @@\
  228.     $(RM) $@                             @@\
  229.     $(MV) $@~ $@                            @@\
  230.     @if $(SOSYMLINK); then (set -x; \                @@\
  231.       $(RM) Concat(lib,libname.so); \                @@\
  232.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  233.     LinkBuildLibrary($@)                        @@\
  234.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  235.                                     @@\
  236. clean::                                    @@\
  237.     @MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \    @@\
  238.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  239.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  240.  
  241. #endif /* SharedDepLibraryTarget */
  242.  
  243. /*
  244.  * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
  245.  */
  246. #ifndef SharedDepCplusplusLibraryTarget
  247. #define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up) @@\
  248. AllTarget(Concat(lib,libname.so.rev))                    @@\
  249.                                     @@\
  250. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  251.     $(RM) $@~                            @@\
  252.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \        @@\
  253.         (cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  254.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  255.         LinkBuildSonameLibrary($$SONAME)            @@\
  256.     $(RM) $@                             @@\
  257.     $(MV) $@~ $@                            @@\
  258.     @if $(SOSYMLINK); then (set -x; \                @@\
  259.       $(RM) Concat(lib,libname.so); \                @@\
  260.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  261.     LinkBuildLibrary($@)                        @@\
  262.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  263.                                     @@\
  264. clean::                                    @@\
  265.     @MAJREV=`echo rev | sed 's/\([0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \    @@\
  266.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  267.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  268.  
  269. #endif /* SharedDepCplusplusLibraryTarget */
  270.  
  271. # ifndef SharedDepModuleTarget
  272. #  define SharedDepModuleTarget(name,deps,solist)            @@\
  273. AllTarget(name)                                @@\
  274.                                     @@\
  275. name: deps                                @@\
  276.     $(RM) $@~                            @@\
  277.     $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  278.     $(RM) $@                            @@\
  279.     $(MV) $@~ $@                            @@\
  280.                                     @@\
  281. clean::                                    @@\
  282.     $(RM) name
  283.  
  284. # endif /* SharedDepModuleTarget */
  285.  
  286. # ifndef SharedDriModuleTarget
  287. #  define SharedDriModuleTarget(name,deps,solist)            @@\
  288. AllTarget(name)                                @@\
  289.                                     @@\
  290. name: deps                                @@\
  291.     $(RM) $@~ $@.map                        @@\
  292.     @(echo 'DRI_MODULE { global: __dri*; local: *; };' > $@.map)    @@\
  293.     $(CC) -o $@~ -Wl,--version-script=$@.map $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  294.     $(RM) $@ $@.map                            @@\
  295.     $(MV) $@~ $@                            @@\
  296.                                     @@\
  297. clean::                                    @@\
  298.     $(RM) name                            @@\
  299.     $(RM) name.map
  300.  
  301. # endif /* SharedDriModuleTarget */
  302.  
  303. /*
  304.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  305.  */
  306. # ifndef SharedLibraryDataTarget
  307. #  define SharedLibraryDataTarget(libname,rev,salist)
  308. # endif /* SharedLibraryTarget */
  309.  
  310. #else /* UseElfFormat */
  311.  
  312. # ifndef SharedDataSeparation
  313. #  define SharedDataSeparation NO
  314. # endif
  315. # ifndef SharedCodeDef
  316. #  define SharedCodeDef /**/
  317. # endif
  318. # ifndef SharedLibraryDef
  319. #  define SharedLibraryDef /**/
  320. # endif
  321. # ifndef ShLibIncludeFile
  322. #  define ShLibIncludeFile <lnxLib.tmpl>
  323. # endif
  324. # ifndef SharedLibraryLoadFlags
  325. #  define SharedLibraryLoadFlags /**/
  326. # endif
  327. # ifndef PositionIndependentCFlags
  328. #  define PositionIndependentCFlags -B/usr/bin/jump
  329. # endif
  330.  
  331. /*
  332.  * These definitions are now extended to work with the X sources and
  333.  * external sources wishing to build shared libs.
  334.  *
  335.  * A library can create it's own shlibs (.so) or can be incorporated into
  336.  * another "host" lib. All libraries generate stub (.sa) files.
  337.  * A "host" lib does all the work to generate the stubs for itself and its
  338.  * "guests", invoking the "guest" Makefiles to create the objects for
  339.  * inclusion into the "host" shlib. A "guest" lib will ask the "host" to
  340.  * create the stubfiles, then copy its own into its directory.
  341.  * Most external libs are "host" libs; the concept of "guest" is a holdover
  342.  * from older libs during the days of scarce shared library address space.
  343.  *
  344.  * To create a simple "host" shared lib, Xfoo, define:
  345.  *
  346.  *  JUMP_ROOT_Xfoo = <source directory>
  347.  *  JUMP_IS_HOST_Xfoo = YES
  348.  *  JUMP_STUBLIBS_Xfoo = libXfoo.sa
  349.  *  JUMP_DIR_Xfoo = $(JUMP_ROOT_Xfoo)/shared        <work directory>
  350.  *  JUMP_DEFS_Xfoo = -DFOO                <defs for jump files>
  351.  *  JUMP_VARS_Xfoo = $(JUMP_ROOT_Xfoo)/jump_vars    <see DLL docs>
  352.  *  JUMP_FUNCS_Xfoo = $(JUMP_ROOT_Xfoo)/jump_funcs    <see DLL docs>
  353.  *  JUMP_IGNORE_Xfoo = $(JUMP_ROOT_Xfoo)/jump_ignore    <see DLL docs>
  354.  *  JUMP_EXPORT_Xfoo = $(JUMP_DIR_Xfoo)/jump.vars    <exported symbols>
  355.  *  JUMP_IMPORT_Xfoo = $(JUMP_EXPORT_Xbar)        <imported symbols>
  356.  *  JUMP_ADDRESS_Xfoo = 0xXXXXXXXX            <fill in with address>
  357.  *  JUMP_JUMPTABLESIZE_Xfoo = 0x4000            <adjust if necessary>
  358.  *  JUMP_GOTSIZE_Xfoo = 4096                <adjust if necessary>
  359.  *  JUMP_STUBNAMES_Xfoo = libXfoo            <and others>
  360.  *  JUMP_STUBS_IMPORT_Xfoo = /usr/lib/libc.sa        <and others>
  361.  *  JUMP_LDLIBS_Xfoo = `$(CC) --print-libgcc-file-name` -lc <and others>
  362.  *
  363.  * To create a complex "host", you need to add
  364.  *  JUMP_SIBARS_Xt = jump/libXbar.a~            <and others>
  365.  * These are the archives of the shared objects of the "guest" libs. They
  366.  * need to be added to the JUMP_LDLIBS_Xfoo lines.
  367.  *
  368.  * For further clarification, study the definitions of libXaw, a simple "host"
  369.  * lib, libXt, a complex "host" lib, and libXmu, one of libXts "guests".
  370.  *
  371.  * As a hint of how to start (with the DLL docs), touch jump_vars, jump_funcs
  372.  * and jump_ignore, then compile. Then massage the jump.vars and jump.funcs
  373.  * files in the shared subdirectory into jump_xxx files.
  374.  */
  375.  
  376. # ifndef UseInstalled
  377. XCOMM These are only needed to build the server
  378.  
  379. #  if LinuxElfDefault
  380. LIBC_SA = /usr/i486-linuxaout/lib/libc.sa
  381. LIBM_SA = /usr/i486-linuxaout/lib/libm.sa
  382. #  else
  383. LIBC_SA = /usr/lib/libc.sa
  384. LIBM_SA = /usr/lib/libm.sa
  385. #  endif
  386.  
  387. JUMP_LDLIBS_libc = `$(CC) --print-libgcc-file-name` -lc
  388.  
  389. XCOMM libX11.so (X11, SM, ICE)
  390. JUMP_ROOT_X11 = $(XLIBSRC)
  391. JUMP_IS_HOST_X11 = YES
  392. JUMP_STUBLIBS_X11 = libX11.sa libSM.sa libICE.sa
  393. JUMP_SIBDIRS_X11 = $(JUMP_ROOT_SM) $(JUMP_ROOT_ICE)
  394. JUMP_DIR_X11 = $(JUMP_ROOT_X11)/shared
  395. JUMP_DEFS_X11 = $(XDMAUTHDEFS) $(XKB_DEFINES)
  396. JUMP_VARS_X11 = $(JUMP_ROOT_X11)/jump_vars
  397. JUMP_FUNCS_X11 = $(JUMP_ROOT_X11)/jump_funcs
  398. JUMP_IGNORE_X11 = $(JUMP_ROOT_X11)/jump_ignore
  399. JUMP_EXPORT_X11 = $(JUMP_DIR_X11)/jump.vars
  400. JUMP_ADDRESS_X11 = 0x60200000
  401. JUMP_JUMPTABLESIZE_X11 = 0x4000
  402. JUMP_GOTSIZE_X11 = 4096
  403. JUMP_STUBNAMES_X11 = libX11 libSM libICE
  404. JUMP_STUBS_IMPORT_X11 = $(LIBC_SA)
  405. JUMP_SIBARS_X11 = jump/libSM.a~ jump/libICE.a~
  406. JUMP_LDLIBS_X11 = $(JUMP_SIBARS_X11) $(JUMP_LDLIBS_libc)
  407.  
  408. XCOMM libSM (part of libX11.so)
  409. JUMP_ROOT_SM = $(SMSRC)
  410. JUMP_IS_HOST_SM = NO
  411. JUMP_HOST_SM = $(JUMP_ROOT_X11)
  412. JUMP_DIR_SM = $(JUMP_DIR_X11)
  413.  
  414. XCOMM libICE (part of libX11.so)
  415. JUMP_ROOT_ICE = $(ICESRC)
  416. JUMP_IS_HOST_ICE = NO
  417. JUMP_HOST_ICE = $(JUMP_ROOT_X11)
  418. JUMP_DIR_ICE = $(JUMP_DIR_X11)
  419.  
  420. XCOMM libXt.so (Xt, Xmu, Xext, Xi, Xtst, Xp)
  421. JUMP_ROOT_Xt = $(TOOLKITSRC)
  422. JUMP_IS_HOST_Xt = YES
  423. JUMP_STUBLIBS_Xt = libXt.sa libXmu.sa libXext.sa libXi.sa libXtst.sa libXp.sa
  424. JUMP_SUBDIRS_Xt = $(JUMP_ROOT_X11)
  425. JUMP_SIBDIRS_Xt = $(JUMP_ROOT_Xmu) $(JUMP_ROOT_Xext) \
  426.     $(JUMP_ROOT_Xi) $(JUMP_ROOT_Xtst) $(JUMP_ROOT_Xp)
  427. JUMP_DIR_Xt = $(JUMP_ROOT_Xt)/shared
  428. JUMP_VARS_Xt = $(JUMP_ROOT_Xt)/jump_vars
  429. JUMP_FUNCS_Xt = $(JUMP_ROOT_Xt)/jump_funcs
  430. JUMP_IGNORE_Xt = $(JUMP_ROOT_Xt)/jump_ignore
  431. JUMP_EXPORT_Xt = $(JUMP_DIR_Xt)/jump.vars
  432. JUMP_IMPORT_Xt = $(JUMP_EXPORT_X11)
  433. JUMP_ADDRESS_Xt = 0x602a0000
  434. JUMP_JUMPTABLESIZE_Xt = 0x4000
  435. JUMP_GOTSIZE_Xt = 4096
  436. JUMP_STUBNAMES_Xt = libXt libXmu libXext libXi libXtst libXp
  437. JUMP_STUBS_IMPORT_Xt = $(JUMP_STUBS_IMPORT_X11)
  438. JUMP_SIBARS_Xt = jump/libXmu.a~ jump/libXext.a~ jump/libXi.a~ jump/libXtst.a~ jump/libXp.a~
  439. JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_ICE)/libICE.sa \
  440.     $(JUMP_ROOT_SM)/libSM.sa $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_libc)
  441.  
  442. XCOMM libXmu (part of libXt.so)
  443. JUMP_ROOT_Xmu = $(XMUSRC)
  444. JUMP_IS_HOST_Xmu = NO
  445. JUMP_HOST_Xmu = $(JUMP_ROOT_Xt)
  446. JUMP_DIR_Xmu = $(JUMP_DIR_Xt)
  447.  
  448. XCOMM libXext (part of libXt.so)
  449. JUMP_ROOT_Xext = $(XEXTLIBSRC)
  450. JUMP_IS_HOST_Xext = NO
  451. JUMP_HOST_Xext = $(JUMP_ROOT_Xt)
  452. JUMP_DIR_Xext = $(JUMP_DIR_Xt)
  453.  
  454. XCOMM libXi (part of libXt.so)
  455. JUMP_ROOT_Xi = $(XILIBSRC)
  456. JUMP_IS_HOST_Xi = NO
  457. JUMP_HOST_Xi = $(JUMP_ROOT_Xt)
  458. JUMP_DIR_Xi = $(JUMP_DIR_Xt)
  459.  
  460. XCOMM libXtst (part of libXt.so)
  461. JUMP_ROOT_Xtst = $(XTESTLIBSRC)
  462. JUMP_IS_HOST_Xtst = NO
  463. JUMP_HOST_Xtst = $(JUMP_ROOT_Xt)
  464. JUMP_DIR_Xtst = $(JUMP_DIR_Xt)
  465.  
  466. XCOMM libXp (part of libXt.so)
  467. JUMP_ROOT_Xp = $(XPLIBSRC)
  468. JUMP_IS_HOST_Xp = NO
  469. JUMP_HOST_Xp = $(JUMP_ROOT_Xt)
  470. JUMP_DIR_Xp = $(JUMP_DIR_Xt)
  471.  
  472. XCOMM libXaw.so (Xaw)
  473. JUMP_ROOT_Xaw = $(AWIDGETSRC)
  474. JUMP_IS_HOST_Xaw = YES
  475. JUMP_STUBLIBS_Xaw = libXaw.sa
  476. JUMP_SUBDIRS_Xaw = $(JUMP_ROOT_Xt)
  477. JUMP_DIR_Xaw = $(JUMP_ROOT_Xaw)/shared
  478. JUMP_VARS_Xaw = $(JUMP_ROOT_Xaw)/jump_vars
  479. JUMP_FUNCS_Xaw = $(JUMP_ROOT_Xaw)/jump_funcs
  480. JUMP_IGNORE_Xaw = $(JUMP_ROOT_Xaw)/jump_ignore
  481. JUMP_EXPORT_Xaw = $(JUMP_DIR_Xaw)/jump.vars
  482. JUMP_IMPORT_Xaw = $(JUMP_EXPORT_Xt) $(JUMP_EXPORT_X11)
  483. JUMP_ADDRESS_Xaw = 0x60300000
  484. JUMP_JUMPTABLESIZE_Xaw = 0x4000
  485. JUMP_GOTSIZE_Xaw = 4096
  486. JUMP_STUBNAMES_Xaw = libXaw
  487. JUMP_STUBS_IMPORT_Xaw = $(JUMP_STUBS_IMPORT_X11)
  488. JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \
  489.     $(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \
  490.     $(JUMP_LDLIBS_libc)
  491.  
  492. # endif /* !UseInstalled */
  493.  
  494. /*
  495.  * SharedLibraryDataTarget - generate rules to create shared data file
  496.  */
  497. # ifndef SharedLibraryDataTarget
  498. #  define SharedLibraryDataTarget(libname,rev,salist)
  499. # endif
  500.  
  501. /*
  502.  * SharedLibraryTarget - generate rules to create a shared library;
  503.  * There are two basic flavors of libs: self-generating, which create
  504.  * their own (and possibly other) libs, and hosted, which rely on another
  505.  * lib for all the work.
  506.  */
  507. # ifndef SharedLibraryTarget
  508. #  define SharedLibraryTarget(libname,rev,solist,down,up)        @@\
  509. XCOMM This logic is such to compile the libs in their proper order,    @@\
  510. XCOMM remain dependent on subsidiary libs, and yet minimize local work    @@\
  511.                                     @@\
  512. JUMP_DIR=./jump                                @@\
  513. JUMP_LIB=Concat(lib,libname)                        @@\
  514.                                     @@\
  515. XCOMM  this is needed for newer gnumake versions            @@\
  516. export JUMP_DIR JUMP_LIB                        @@\
  517.                                     @@\
  518. JUMP_IS_HOST=$(Concat(JUMP_IS_HOST_,libname))                @@\
  519. JUMP_AR=$(JUMP_DIR)/Concat(lib,libname.a~)                @@\
  520. JUMP_SA=Concat(lib,libname.sa)                        @@\
  521. JUMP_SO=Concat(lib,libname.so.rev)                    @@\
  522.                                     @@\
  523. JUMP_HOST=$(Concat(JUMP_HOST_,libname))                    @@\
  524.                                     @@\
  525. INSTSOLIBFLAGS=-m 0555                            @@\
  526.                                     @@\
  527. AllTarget($(BUILDLIBDIR)/$(JUMP_SA))                    @@\
  528.                                     @@\
  529. $(BUILDLIBDIR)/$(JUMP_SA): $(JUMP_SA)                    @@\
  530.     LinkBuildLibrary($(JUMP_SA))                    @@\
  531.                                     @@\
  532. $(JUMP_SA) $(Concat(JUMP_STUBLIBS_,libname)) do_JUMP_SA: \
  533.         down/mk_JUMP_SA_$(JUMP_IS_HOST)                @@\
  534.                                     @@\
  535. down/mk_JUMP_SA_0:: mk_JUMP_HOST                    @@\
  536.                                     @@\
  537. down/mk_JUMP_SA_0:: $(JUMP_HOST)/$(JUMP_SA)                @@\
  538.     $(RM) $(JUMP_SA)                        @@\
  539.     $(LN) $(JUMP_HOST)/$(JUMP_SA) $(JUMP_SA)            @@\
  540.     touch $@                            @@\
  541.                                     @@\
  542. down/mk_JUMP_SA_1:: $(JUMP_SO)                        @@\
  543.                                     @@\
  544. down/mk_JUMP_SA_1:: down/mk_JUMP_SO_2                    @@\
  545.     $(RM) $(Concat(JUMP_STUBLIBS_,libname))                @@\
  546.     mkstubs -v rev -l $(JUMP_LIB) \
  547.         -a $(Concat(JUMP_ADDRESS_,libname)) \
  548.         -j $(Concat(JUMP_JUMPTABLESIZE_,libname)) \
  549.         -g $(Concat(JUMP_GOTSIZE_,libname)) \
  550.         -- $(Concat(JUMP_STUBNAMES_,libname))            @@\
  551.     verify-shlib -l $(JUMP_SO) \
  552.         $(Concat(JUMP_STUBLIBS_,libname))            @@\
  553.     $(MV) verify.out $(JUMP_DIR)                    @@\
  554.     touch $@                            @@\
  555.                                     @@\
  556. mk_JUMP_HOST:                                @@\
  557.     @echo checking stub library $(JUMP_SA) in $(JUMP_HOST)...    @@\
  558.     @(cd $(JUMP_HOST); $(MAKE) $(MFLAGS) $(JUMP_SA)) || exit 1    @@\
  559.     @echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...    @@\
  560.                                     @@\
  561. $(JUMP_SO): down/mk_JUMP_SO_$(JUMP_IS_HOST)                @@\
  562.                                     @@\
  563. down/mk_JUMP_SO_0:                            @@\
  564.                                     @@\
  565. down/mk_JUMP_SO_1:: $(JUMP_AR) mk_JUMP_SIBDIRS down/mk_JUMP_SO_2    @@\
  566.                                     @@\
  567. down/mk_JUMP_SO_2: down/mk_JUMP_AR $(Concat(JUMP_SIBARS_,libname))    @@\
  568.     $(RM) $(JUMP_SO)                        @@\
  569.     mkimage -f -v rev -l $(JUMP_LIB) \
  570.         -a $(Concat(JUMP_ADDRESS_,libname)) \
  571.         -j $(Concat(JUMP_JUMPTABLESIZE_,libname)) \
  572.         -g $(Concat(JUMP_GOTSIZE_,libname)) \
  573.         -- $(JUMP_AR) $(Concat(JUMP_LDLIBS_,libname))        @@\
  574.     $(RM) $(JUMP_DIR)/__jump.s $(JUMP_DIR)/__jump.o            @@\
  575.     LinkBuildLibrary($(JUMP_SO))                    @@\
  576.     touch $@                            @@\
  577.                                     @@\
  578. mk_JUMP_SIBDIRS:                            @@\
  579.     @for d in $(Concat(JUMP_SIBDIRS_,libname)); do \
  580.         echo checking ar library in $$d...; \
  581.         (cd $$d ; $(MAKE) $(MFLAGS) fastdo_JUMP_AR) || exit 1; \
  582.         echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...;done@@\
  583.                                     @@\
  584. fastdo_JUMP_AR: $(JUMP_DIR) down/mk_JUMP_AR                @@\
  585.                                     @@\
  586. $(JUMP_AR) do_JUMP_AR:: jumpsetup down/mk_JUMP_AR            @@\
  587.                                     @@\
  588. jumpsetup: $(JUMP_DIR) jumpsetup_$(JUMP_IS_HOST)            @@\
  589.                                     @@\
  590. $(JUMP_DIR):                                @@\
  591.     $(RM) jump                            @@\
  592.     LibMkdir($(Concat(JUMP_DIR_,libname)))                @@\
  593.     $(LN) $(Concat(JUMP_DIR_,libname)) jump                @@\
  594.                                     @@\
  595. jumpsetup_0:                                @@\
  596.     @echo doing jump setup in host $(JUMP_HOST)...            @@\
  597.     @(cd $(JUMP_HOST); $(MAKE) $(MFLAGS) jumpsetup) || exit 1    @@\
  598.     @echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...    @@\
  599.                                     @@\
  600. jumpsetup_1::                                @@\
  601.     @for d in $(Concat(JUMP_SUBDIRS_,libname)); do \
  602.         echo checking stub library in $$d...; \
  603.         (cd $$d ; $(MAKE) $(MFLAGS) do_JUMP_SA) || exit 1; \
  604.         echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...;done@@\
  605.                                     @@\
  606. jumpsetup_1:: $(JUMP_DIR)/jump.funcs $(JUMP_DIR)/jump.vars \
  607.     $(JUMP_DIR)/jump.ignore $(JUMP_DIR)/jump.import            @@\
  608.                                     @@\
  609. $(JUMP_DIR)/jump.funcs: $(Concat(JUMP_FUNCS_,libname))            @@\
  610.     $(RM) $(JUMP_DIR)/jump.funcs                    @@\
  611.     cat $(Concat(JUMP_FUNCS_,libname)) | \
  612.         $(CPP) $(ALLDEFINES) $(Concat(JUMP_DEFS_,libname)) > $@    @@\
  613.                                     @@\
  614. $(JUMP_DIR)/jump.vars: $(Concat(JUMP_VARS_,libname))            @@\
  615.     $(RM) $(JUMP_DIR)/jump.vars                    @@\
  616.     cat $(Concat(JUMP_VARS_,libname)) | \
  617.         $(CPP) $(ALLDEFINES) $(Concat(JUMP_DEFS_,libname)) > $@    @@\
  618.                                     @@\
  619. $(JUMP_DIR)/jump.ignore: $(Concat(JUMP_IGNORE_,libname))        @@\
  620.     $(RM) $(JUMP_DIR)/jump.ignore                    @@\
  621.     cat $(Concat(JUMP_IGNORE_,libname)) | \
  622.         $(CPP) $(ALLDEFINES) $(Concat(JUMP_DEFS_,libname)) > $@    @@\
  623.                                     @@\
  624. $(JUMP_DIR)/jump.import: $(JUMP_DIR)/stubs.import \
  625.         $(Concat(JUMP_IMPORT_,libname))                @@\
  626.     $(RM) $(JUMP_DIR)/jump.import                    @@\
  627.     cat $(JUMP_DIR)/stubs.import $(Concat(JUMP_IMPORT_,libname)) > $@ @@\
  628.                                     @@\
  629. $(JUMP_DIR)/stubs.import: $(Concat(JUMP_STUBS_IMPORT_,libname))        @@\
  630.     $(RM) $(JUMP_DIR)/stubs.import                    @@\
  631.     nm --no-cplus $(Concat(JUMP_STUBS_IMPORT_,libname)) | grep '__GOT__' | \
  632.         sed 's/__GOT__/_/' > $@                    @@\
  633.                                     @@\
  634. down/mk_JUMP_AR: solist                            @@\
  635.     $(RM) $(JUMP_AR)                        @@\
  636.     @if [ -s $(JUMP_DIR)/jump.log ]; then \
  637.         echo "Error: Leftover globals for shared lib"; \
  638.         exit 1; fi                        @@\
  639.     (cd down; $(AR) up/$(JUMP_AR) solist) || exit 1            @@\
  640.     $(RANLIB) $(JUMP_AR)                        @@\
  641.     touch $@                            @@\
  642.                                     @@\
  643. clean:: jumpclean                            @@\
  644.                                     @@\
  645. jumpclean: jumpclean_$(JUMP_IS_HOST)                    @@\
  646.     $(RM) $(JUMP_SA) down/mk_JUMP_AR                @@\
  647.     $(RM) -r $(JUMP_DIR)                        @@\
  648.                                     @@\
  649. jumpclean_0:                                @@\
  650.     $(RM) down/mk_JUMP_SA_0                        @@\
  651.     $(RM) $(JUMP_HOST)/$(JUMP_SA)                    @@\
  652.                                     @@\
  653. jumpclean_1:                                @@\
  654.     $(RM) -r $(JUMP_SO) $(Concat(JUMP_DIR_,libname)) \        @@\
  655.         down/mk_JUMP_SA_1 down/mk_JUMP_SO_1 down/mk_JUMP_SO_2
  656. # endif /* SharedLibraryTarget */
  657.  
  658. /*
  659.  * InstallSharedLibrary - generate rules to install the shared library.
  660.  */
  661. # ifndef InstallSharedLibrary
  662. #  define    InstallSharedLibrary(libname,rev,dest)            @@\
  663. install:: $(JUMP_SA) $(JUMP_SO)                        @@\
  664.     MakeDir($(DESTDIR)dest)                        @@\
  665.     @if [ "$(JUMP_IS_HOST)" = YES ]; then \
  666.         (T=$(DESTDIR)dest/`echo $(JUMP_SO)|sed '/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/`;\
  667.         set -x; \
  668.         $(INSTALL) -s -c $(INSTSOLIBFLAGS) $(JUMP_SO) $(DESTDIR)dest; \
  669.         $(RM) $$T && $(LN) $(JUMP_SO) $$T); fi            @@\
  670.     $(INSTALL) -c $(INSTLIBFLAGS) $(JUMP_SA) $(DESTDIR)dest
  671. # endif /* InstallSharedLibrary */
  672.  
  673. /*
  674.  * InstallSharedLibraryData - generate rules to install the shared library data
  675.  */
  676. # ifndef InstallSharedLibraryData
  677. #  define    InstallSharedLibraryData(libname,rev,dest)
  678. # endif /* InstallSharedLibraryData */
  679.  
  680. #endif /* UseElfFormat */
  681.